package com.cloudkinto.service.shipprice;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderOutputPackageDetailDo;
import com.cloudkinto.entity.OrderOutputProductDo;
import com.cloudkinto.entity.ShipPriceDo;
import com.cloudkinto.service.shipprice.vo.ComputePriceReq;
import com.cloudkinto.service.shipprice.vo.WarehousingPriceReq;

import java.util.List;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author ding
 * @since 2020-06-09
 */
public interface ShipPriceService extends IService<ShipPriceDo> {



    ShipPriceDo queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Long storageId, Long trackId, int version, Integer bundling);

    ShipPriceDo queryByRegionAndSize(Long stateId, double weight, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, Long trackId, int version, Integer bundling);

    ShipPriceDo queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, Long trackId, int version);

        /**
         * @param stateId 地区id
         * @param weight 重量
         * @param size  尺寸 (三边和/体积重)
         * @param storageId
         * @param trackId 快递公司id   不指定为0
         * @param version
         * @return
         */
    ShipPriceDo queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, Long trackId, int version, Integer bundling);

    List<ShipPriceDo> queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Long storageId, int version, Integer bundling);

    List<ShipPriceDo> queryByRegionAndSize(String postCode, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, int version);

    List<ShipPriceDo> queryByRegionAndSize(String postCode, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, int version, Integer bundling);

    List<ShipPriceDo> queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, int version);

    List<ShipPriceDo> queryByRegionAndSize(Long stateId, double weight, double size, Double longest, Double minor, Double shortest, Integer cod, Integer shipmentType, Long storageId, int version, Integer bundling);

    SingleResult computePrice(ComputePriceReq req, Long userId, Long companyId);

    SingleResult computeInit();

    double[] getMulitSkuSize(List<OrderOutputProductDo> productDoList);

    int getMulitSkuOperationFeeNoPackage(List<OrderOutputProductDo> productDoList, String companyId);

    int getMulitSkuOperationFee(List<OrderOutputPackageDetailDo> packageDetailDoList, List<OrderOutputProductDo> productDoList, String companyId);

    int getSameSkuOperationFee(Long productId, int count, String companyId);

    double[] countSameSkuSize(Long productId, int count);

    double[] countSameSkuSize(double[] finalSize, Long productId, int count);

    double[] countSameSkuSizeNew(double[] inputSize, Long productId, int count);

    double[] countSameSkuSizeNew(double[] inputSize, double size0, double size1, double size2, double weight, int count);

    double[] getSizeOrderDesc(double width, double height, double length);

    SingleResult warehousingPrice(WarehousingPriceReq req, Long userId, Long companyId);
}
